package com.nanjia.boot.batch_stock.model.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 库存记录表单对象
 *
 * @author 周洋
 * @since 2025-08-22 11:27
 */
@Getter
@Setter
@Schema(description = "库存记录表单对象")
public class WarehouseBatchStockForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "不能为空")
    private Long id;

    @Schema(description = "仓库ID")
    @NotNull(message = "仓库ID不能为空")
    private Long warehouseId;

    @Schema(description = "批次ID")
    @NotNull(message = "批次ID不能为空")
    private Long batchId;

    @Schema(description = "库存数量")
    @NotNull(message = "库存数量不能为空")
    private Integer quantity;

    @Schema(description = "库存状态")
    @NotNull(message = "库存状态不能为空")
    @Size(max=3, message="库存状态长度不能超过3个字符")
    private String stockStatus;

    @Schema(description = "库位号")
    @NotNull(message = "库位号不能为空")
    private Long storageLocationId;

    @Schema(description = "最近盘点日期")
    private LocalDate lastInventory;

    @NotNull(message = "不能为空")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @NotNull(message = "不能为空")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @NotBlank(message = "不能为空")
    @Size(max=20, message="长度不能超过20个字符")
    private String createBy;

    private String updateBy;

    @Size(max=40, message="长度不能超过40个字符")
    private String createIp;

    @Size(max=40, message="长度不能超过40个字符")
    private String updateIp;


}
